/*

*/

component

	New()
		..()
		uses = new /restricted(0, max_uses, max_uses)
		spawn restore()

	var
		//a datum containing many useful functions related to it's uses
		restricted/uses

		//the maximum amount of uses for this spell
		max_uses

		//how fast the spell restores uses (in ms)
		restore_speed = 100

		//this is basically a multiplier, used strictly by calc_tier()
		factor = 1

		//the name of the component
		name

		//the element represented by this component
		element

		//the total boost given by this component. this contains both the type of boost, and the amount
		boost

		//the tier of component this is -- this prevents it from being scribed at an early level
		tier

		//the container for this component
		spell/body

		//the required ink to use this component (stored as a type path)
		required_ink

		//only one of these should be required.. not sure why I keep track of both.
		component
			parent
			child

	proc
		use(mob/caster, mob/target[])
			if(max_uses == -1) return 0
			uses.decrease(body.component_count[name])

		revitalize()
			uses.set_max()

		restore()
			while(src)
				if(uses.get_current()>0 && !uses.at_max())
					uses.increase(1)
				sleep(restore_speed)
